<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function user(name, age) {
            this.name = name;
            this.age = age;
        };
        user.prototype.getName = function (num) {
            console.log("姓名是", this.name);
            this.name*=num;
            return this;
        };
        user.prototype.getAge = function () {
            console.log("年龄是", this.age);
            return this;
        };
        new user("zjf", 22).getName().getAge();
    //姓名是 zjf
    //年龄是 22
    </script>
</body>

</html>